import { defineEventHandler, getQuery } from 'h3';

export default defineEventHandler(async (event) => {
  const query = getQuery(event);

  // 多业态资源数据 - 支持酒店、公寓、温泉、景区、餐饮、医美、美容美发等业态
  const resources = [
    // ==================== 酒店业态 ====================
    {
      id: 1,
      name: '豪华酒店主楼',
      code: 'HOTEL_MAIN_BUILDING',
      resource_type: 'PHYSICAL',
      resource_type_name: '物理资源',
      resource_sub_type: 'BUILDING',
      resource_sub_type_name: '建筑物',
      parent_id: null,
      parent_name: null,
      level: 1,
      icon: 'ant-design:bank-outlined',
      color: '#1890ff',
      image_url: '/images/hotel-building.jpg',
      status: 1,
      description: '豪华酒店主楼，25层建筑，200间客房',
      properties: JSON.stringify({
        // 使用VbenFormSchema格式的属性定义
        schema: [
          {
            fieldName: 'building_type',
            label: '建筑类型',
            component: 'Select',
            componentProps: {
              placeholder: '请选择建筑类型',
              options: [
                { label: '酒店', value: '酒店' },
                { label: '公寓', value: '公寓' },
                { label: '办公楼', value: '办公楼' },
                { label: '商场', value: '商场' },
                { label: '医院', value: '医院' },
                { label: '学校', value: '学校' },
              ],
              showSearch: true,
            },
            rules: 'required',
            defaultValue: '酒店',
          },
          {
            fieldName: 'floors',
            label: '楼层数',
            component: 'InputNumber',
            componentProps: {
              placeholder: '请输入楼层数',
              min: 1,
              max: 200,
              addonAfter: '层',
            },
            rules: 'required',
            defaultValue: 25,
          },
          {
            fieldName: 'total_rooms',
            label: '房间总数',
            component: 'InputNumber',
            componentProps: {
              placeholder: '请输入房间总数',
              min: 1,
              max: 10000,
              addonAfter: '间',
            },
            rules: 'required',
            defaultValue: 200,
          },
          {
            fieldName: 'construction_year',
            label: '建造年份',
            component: 'InputNumber',
            componentProps: {
              placeholder: '请输入建造年份',
              min: 1900,
              max: 2030,
              addonAfter: '年',
            },
            rules: 'required',
            defaultValue: 2020,
          },
          {
            fieldName: 'building_area',
            label: '建筑面积',
            component: 'InputNumber',
            componentProps: {
              placeholder: '请输入建筑面积',
              min: 1,
              max: 1000000,
              addonAfter: '平方米',
              formatter: (value: number) => `${value.toLocaleString()}`,
              parser: (value: string) => value.replace(/\D/g, ''),
            },
            rules: 'required',
            defaultValue: 15000,
          },
          {
            fieldName: 'parking_spaces',
            label: '停车位数量',
            component: 'InputNumber',
            componentProps: {
              placeholder: '请输入停车位数量',
              min: 0,
              max: 10000,
              addonAfter: '个',
            },
            defaultValue: 100,
          },
          {
            fieldName: 'facilities',
            label: '配套设施',
            component: 'Select',
            componentProps: {
              mode: 'multiple',
              placeholder: '请选择配套设施',
              options: [
                { label: '大堂', value: '大堂' },
                { label: '餐厅', value: '餐厅' },
                { label: '会议室', value: '会议室' },
                { label: '健身房', value: '健身房' },
                { label: '游泳池', value: '游泳池' },
                { label: 'SPA中心', value: 'SPA中心' },
                { label: '商务中心', value: '商务中心' },
                { label: '停车场', value: '停车场' },
                { label: '电梯', value: '电梯' },
                { label: '门禁系统', value: '门禁系统' },
                { label: '监控系统', value: '监控系统' },
                { label: '消防系统', value: '消防系统' },
              ],
              showSearch: true,
              allowClear: true,
            },
            defaultValue: ['大堂', '餐厅', '会议室', '健身房', '游泳池'],
          },
          {
            fieldName: 'service_quality',
            label: '服务质量等级',
            component: 'Select',
            componentProps: {
              placeholder: '请选择服务质量等级',
              options: [
                { label: '三星级', value: '三星级' },
                { label: '四星级', value: '四星级' },
                { label: '五星级', value: '五星级' },
                { label: '六星级', value: '六星级' },
              ],
            },
            defaultValue: '五星级',
          },
          {
            fieldName: 'building_status',
            label: '建筑状态',
            component: 'Select',
            componentProps: {
              placeholder: '请选择建筑状态',
              options: [
                { label: '正常运营', value: '正常运营' },
                { label: '装修中', value: '装修中' },
                { label: '暂停营业', value: '暂停营业' },
                { label: '已停业', value: '已停业' },
              ],
            },
            rules: 'required',
            defaultValue: '正常运营',
          },
        ],
        // 属性数据
        data: {
          building_type: '酒店',
          floors: 25,
          total_rooms: 200,
          construction_year: 2020,
          building_area: 15000,
          parking_spaces: 100,
          facilities: ['大堂', '餐厅', '会议室', '健身房', '游泳池'],
          service_quality: '五星级',
          building_status: '正常运营',
        },
      }),
      capabilities: JSON.stringify([
        {
          id: 'room_management',
          code: 'ROOM_MANAGEMENT',
          name: '客房管理能力',
          description: '提供客房状态管理、房态更新、房间分配等核心能力',
          icon: 'ant-design:home-outlined',
          color: '#52c41a',
          type: 'business',
          enabled: true,
          priority: 95,
          version: '1.0.0',
          tags: ['客房管理', '房态管理'],
          implementation: {
            type: 'service',
            serviceName: 'roomManagementService',
            methodName: 'updateRoomStatus',
            parameters: {
              statusTypes: [
                'vacant',
                'occupied',
                'reserved',
                'maintenance',
                'dirty',
              ],
              enableRealTimeSync: true,
              autoStatusTransition: true,
            },
          },
        },
        {
          id: 'booking_management',
          code: 'BOOKING_MANAGEMENT',
          name: '预订管理能力',
          description: '提供客房预订、订单处理、预订确认等业务能力',
          icon: 'ant-design:calendar-outlined',
          color: '#1890ff',
          type: 'business',
          enabled: true,
          priority: 90,
          version: '1.0.0',
          tags: ['预订管理', '订单处理'],
          implementation: {
            type: 'service',
            serviceName: 'bookingManagementService',
            methodName: 'processBooking',
            parameters: {
              bookingTypes: ['individual', 'group', 'corporate'],
              paymentMethods: ['cash', 'card', 'online', 'voucher'],
              enableOverbooking: true,
              maxOverbookingRate: 0.1,
            },
          },
        },
        {
          id: 'checkin_checkout',
          code: 'CHECKIN_CHECKOUT',
          name: '入住退房能力',
          description: '提供客人入住登记、退房结算、房卡管理等能力',
          icon: 'ant-design:user-add-outlined',
          color: '#722ed1',
          type: 'business',
          enabled: true,
          priority: 85,
          version: '1.0.0',
          tags: ['入住管理', '退房管理'],
          implementation: {
            type: 'workflow',
            processDefinitionId: 'checkin_checkout_process',
            version: '1.0.0',
            parameters: {
              enableAutoCheckout: true,
              lateCheckoutAllowed: true,
              maxLateCheckoutHours: 2,
              enableExpressCheckout: true,
            },
          },
        },
        {
          id: 'pricing_engine',
          code: 'PRICING_ENGINE',
          name: '定价引擎能力',
          description: '提供动态定价、价格策略、优惠计算等能力',
          icon: 'ant-design:dollar-outlined',
          color: '#fa8c16',
          type: 'business',
          enabled: true,
          priority: 80,
          version: '1.0.0',
          tags: ['定价策略', '价格管理'],
          implementation: {
            type: 'rule',
            ruleSetName: 'hotel_pricing_rules',
            engine: 'drools',
            parameters: {
              pricingFactors: ['season', 'occupancy', 'competition', 'demand'],
              enableDynamicPricing: true,
              updateFrequency: 'hourly',
              enableAIBasedPricing: true,
            },
          },
        },
        {
          id: 'guest_service',
          code: 'GUEST_SERVICE',
          name: '客人服务能力',
          description: '提供客人服务请求、客房服务、投诉处理等能力',
          icon: 'ant-design:customer-service-outlined',
          color: '#eb2f96',
          type: 'business',
          enabled: true,
          priority: 75,
          version: '1.0.0',
          tags: ['客人服务', '投诉处理'],
          implementation: {
            type: 'service',
            serviceName: 'guestServiceService',
            methodName: 'handleServiceRequest',
            parameters: {
              serviceTypes: [
                'room_service',
                'housekeeping',
                'maintenance',
                'concierge',
              ],
              priorityLevels: ['low', 'medium', 'high', 'urgent'],
              enableAutoAssignment: true,
            },
          },
        },
        {
          id: 'housekeeping_management',
          code: 'HOUSEKEEPING_MANAGEMENT',
          name: '客房清洁能力',
          description: '提供客房清洁计划、清洁状态跟踪、清洁质量检查等能力',
          icon: 'ant-design:clean-outlined',
          color: '#13c2c2',
          type: 'business',
          enabled: true,
          priority: 70,
          version: '1.0.0',
          tags: ['客房清洁', '质量检查'],
          implementation: {
            type: 'workflow',
            processDefinitionId: 'housekeeping_process',
            version: '1.0.0',
            parameters: {
              cleaningSchedule: 'daily',
              qualityCheckRequired: true,
              enableRealTimeTracking: true,
            },
          },
        },
        {
          id: 'pms_integration',
          code: 'PMS_INTEGRATION',
          name: 'PMS系统集成能力',
          description: '提供与酒店PMS系统的数据同步和业务集成能力',
          icon: 'ant-design:api-outlined',
          color: '#1890ff',
          type: 'technical',
          enabled: true,
          priority: 85,
          version: '1.0.0',
          tags: ['系统集成', '数据同步'],
          implementation: {
            type: 'api',
            apiEndpoint: '/api/pms/integration',
            method: 'POST',
            parameters: {
              syncInterval: '5min',
              enableRealTimeSync: true,
              dataTypes: ['booking', 'room_status', 'guest_info'],
            },
          },
        },
        {
          id: 'payment_gateway',
          code: 'PAYMENT_GATEWAY',
          name: '支付网关能力',
          description: '提供多种支付方式集成和支付处理能力',
          icon: 'ant-design:credit-card-outlined',
          color: '#52c41a',
          type: 'technical',
          enabled: true,
          priority: 80,
          version: '1.0.0',
          tags: ['支付处理', '网关集成'],
          implementation: {
            type: 'service',
            serviceName: 'paymentGatewayService',
            methodName: 'processPayment',
            parameters: {
              paymentMethods: [
                'alipay',
                'wechat',
                'unionpay',
                'visa',
                'mastercard',
              ],
              enableRefund: true,
              enablePartialRefund: true,
            },
          },
        },
        {
          id: 'iot_device_management',
          code: 'IOT_DEVICE_MANAGEMENT',
          name: 'IoT设备管理能力',
          description: '提供智能门锁、温控器、照明等IoT设备管理能力',
          icon: 'ant-design:setting-outlined',
          color: '#722ed1',
          type: 'technical',
          enabled: true,
          priority: 70,
          version: '1.0.0',
          tags: ['IoT设备', '智能控制'],
          implementation: {
            type: 'service',
            serviceName: 'iotDeviceService',
            methodName: 'controlDevice',
            parameters: {
              deviceTypes: [
                'smart_lock',
                'thermostat',
                'lighting',
                'tv',
                'curtain',
              ],
              enableRemoteControl: true,
              enableAutomation: true,
            },
          },
        },
        {
          id: 'real_time_communication',
          code: 'REAL_TIME_COMMUNICATION',
          name: '实时通信能力',
          description: '提供客房服务、前台沟通等实时消息通信能力',
          icon: 'ant-design:message-outlined',
          color: '#fa8c16',
          type: 'technical',
          enabled: true,
          priority: 75,
          version: '1.0.0',
          tags: ['实时通信', '消息推送'],
          implementation: {
            type: 'service',
            serviceName: 'communicationService',
            methodName: 'sendMessage',
            parameters: {
              messageTypes: ['notification', 'alert', 'reminder'],
              enablePushNotification: true,
              enableSMS: true,
            },
          },
        },
        {
          id: 'data_analytics',
          code: 'DATA_ANALYTICS',
          name: '数据分析能力',
          description: '提供酒店运营数据分析和商业智能能力',
          icon: 'ant-design:bar-chart-outlined',
          color: '#eb2f96',
          type: 'technical',
          enabled: true,
          priority: 65,
          version: '1.0.0',
          tags: ['数据分析', '商业智能'],
          implementation: {
            type: 'service',
            serviceName: 'analyticsService',
            methodName: 'analyzeData',
            parameters: {
              analysisTypes: [
                'occupancy',
                'revenue',
                'guest_satisfaction',
                'operational_efficiency',
              ],
              enablePredictiveAnalytics: true,
              enableRealTimeDashboards: true,
            },
          },
        },
        {
          id: 'security_monitoring',
          code: 'SECURITY_MONITORING',
          name: '安全监控能力',
          description: '提供酒店安全监控、门禁管理、访客登记等能力',
          icon: 'ant-design:safety-outlined',
          color: '#ff4d4f',
          type: 'technical',
          enabled: true,
          priority: 80,
          version: '1.0.0',
          tags: ['安全监控', '门禁管理'],
          implementation: {
            type: 'service',
            serviceName: 'securityService',
            methodName: 'monitorSecurity',
            parameters: {
              monitoringTypes: [
                'cctv',
                'access_control',
                'fire_alarm',
                'emergency_exit',
              ],
              enableFacialRecognition: true,
              enableVisitorManagement: true,
            },
          },
        },
      ]),
      constraints: JSON.stringify({
        max_height: 80,
        fire_safety: true,
        building_codes: '符合当地建筑规范',
        accessibility: '符合无障碍设计标准',
      }),
      metadata: JSON.stringify({
        business_type: 'HOTEL',
        address: '市中心商业区A座',
        property_management: '自营',
        star_rating: 5,
        certification: 'ISO9001',
      }),
      trading: JSON.stringify({
        pricing: {
          costPrice: 5000000,
          operationalCost: 200000,
          standardPrice: 8000000,
          discountPrice: 7200000,
          monthlyPrice: 500000,
          yearlyPrice: 5000000,
        },
        partners: [
          {
            id: 1,
            name: '酒店管理系统',
            type: 'SYSTEM',
            status: 'active',
            description: '核心业务系统',
          },
          {
            id: 2,
            name: '清洁服务团队',
            type: 'SERVICE',
            status: 'active',
            description: '客房清洁服务',
          },
        ],
        rules: [
          {
            id: 1,
            name: '批量预订优惠',
            type: 'DISCOUNT',
            enabled: true,
            description: '批量预订超过10间享受8折优惠',
          },
          {
            id: 2,
            name: '长期合作优惠',
            type: 'LOYALTY',
            enabled: true,
            description: '合作超过1年享受额外5%优惠',
          },
        ],
        history: [
          {
            id: 1,
            type: 'PURCHASE',
            amount: 500000,
            partner: '酒店管理系统',
            status: 'completed',
            timestamp: '2024-01-15 10:00:00',
          },
          {
            id: 2,
            type: 'SERVICE',
            amount: 50000,
            partner: '清洁服务团队',
            status: 'completed',
            timestamp: '2024-01-14 15:30:00',
          },
        ],
      }),
      business_type: 'HOTEL',
      business_type_name: '酒店业务',
      business_id: 1,
      tenant_id: 1,
      creator: 'admin',
      create_time: '2024-01-01 00:00:00',
      updater: 'admin',
      update_time: '2024-01-01 00:00:00',
      deleted: 0,
    },

    {
      id: 2,
      name: '15楼',
      code: 'HOTEL_FLOOR_15',
      resource_type: 'PHYSICAL',
      resource_type_name: '物理资源',
      resource_sub_type: 'FLOOR',
      resource_sub_type_name: '楼层',
      parent_id: 1,
      parent_name: '豪华酒店主楼',
      level: 2,
      icon: 'ant-design:home-outlined',
      color: '#52c41a',
      image_url: '/images/hotel-floor.jpg',
      status: 1,
      description: '酒店15楼，行政楼层，8间客房',
      properties: JSON.stringify({
        floor_number: 15,
        room_count: 8,
        floor_type: '行政楼层',
        room_types: ['行政套房', '豪华套房', '标准套房'],
        facilities: ['行政酒廊', '商务中心', '会议室'],
        elevator_access: true,
        security_level: 'high',
      }),
      capabilities: JSON.stringify([
        {
          id: 'guest_service',
          code: 'GUEST_SERVICE',
          name: '客人服务能力',
          description: '提供客人服务请求、客房服务、投诉处理等能力',
          icon: 'ant-design:customer-service-outlined',
          color: '#eb2f96',
          type: 'business',
          enabled: true,
          priority: 80,
          version: '1.0.0',
          tags: ['客人服务', '投诉处理'],
          implementation: {
            type: 'service',
            serviceName: 'guestServiceService',
            methodName: 'handleServiceRequest',
            parameters: {
              serviceTypes: [
                'room_service',
                'housekeeping',
                'maintenance',
                'concierge',
              ],
              priorityLevels: ['low', 'medium', 'high', 'urgent'],
              enableAutoAssignment: true,
            },
          },
        },
        {
          id: 'housekeeping_management',
          code: 'HOUSEKEEPING_MANAGEMENT',
          name: '客房清洁能力',
          description: '提供客房清洁计划、清洁状态跟踪、清洁质量检查等能力',
          icon: 'ant-design:clean-outlined',
          color: '#13c2c2',
          type: 'business',
          enabled: true,
          priority: 85,
          version: '1.0.0',
          tags: ['客房清洁', '质量检查'],
          implementation: {
            type: 'workflow',
            processDefinitionId: 'housekeeping_process',
            version: '1.0.0',
            parameters: {
              cleaningSchedule: 'daily',
              qualityCheckRequired: true,
              enableRealTimeTracking: true,
            },
          },
        },
        {
          id: 'iot_device_management',
          code: 'IOT_DEVICE_MANAGEMENT',
          name: 'IoT设备管理能力',
          description: '提供智能门锁、温控器、照明等IoT设备管理能力',
          icon: 'ant-design:setting-outlined',
          color: '#722ed1',
          type: 'technical',
          enabled: true,
          priority: 80,
          version: '1.0.0',
          tags: ['IoT设备', '智能控制'],
          implementation: {
            type: 'service',
            serviceName: 'iotDeviceService',
            methodName: 'controlDevice',
            parameters: {
              deviceTypes: [
                'smart_lock',
                'thermostat',
                'lighting',
                'tv',
                'curtain',
              ],
              enableRemoteControl: true,
              enableAutomation: true,
            },
          },
        },
        {
          id: 'real_time_communication',
          code: 'REAL_TIME_COMMUNICATION',
          name: '实时通信能力',
          description: '提供客房服务、前台沟通等实时消息通信能力',
          icon: 'ant-design:message-outlined',
          color: '#fa8c16',
          type: 'technical',
          enabled: true,
          priority: 75,
          version: '1.0.0',
          tags: ['实时通信', '消息推送'],
          implementation: {
            type: 'service',
            serviceName: 'communicationService',
            methodName: 'sendMessage',
            parameters: {
              messageTypes: ['notification', 'alert', 'reminder'],
              enablePushNotification: true,
              enableSMS: true,
            },
          },
        },
        {
          id: 'security_monitoring',
          code: 'SECURITY_MONITORING',
          name: '安全监控能力',
          description: '提供酒店安全监控、门禁管理、访客登记等能力',
          icon: 'ant-design:safety-outlined',
          color: '#ff4d4f',
          type: 'technical',
          enabled: true,
          priority: 85,
          version: '1.0.0',
          tags: ['安全监控', '门禁管理'],
          implementation: {
            type: 'service',
            serviceName: 'securityService',
            methodName: 'monitorSecurity',
            parameters: {
              monitoringTypes: [
                'cctv',
                'access_control',
                'fire_alarm',
                'emergency_exit',
              ],
              enableFacialRecognition: true,
              enableVisitorManagement: true,
            },
          },
        },
      ]),
      constraints: JSON.stringify({
        access_control: '房卡+人脸识别',
        cleaning_schedule: '每日清洁',
        maintenance_window: '10:00-12:00',
        noise_restriction: '22:00-08:00',
      }),
      metadata: JSON.stringify({
        business_type: 'HOTEL',
        floor_manager: '李主管',
        housekeeping_supervisor: '王阿姨',
        security_level: 'VIP',
      }),
      business_type: 'HOTEL',
      business_id: 1,
      tenant_id: 1,
      creator: 'admin',
      create_time: '2024-01-01 00:00:00',
      updater: 'admin',
      update_time: '2024-01-01 00:00:00',
      deleted: 0,
    },

    {
      id: 3,
      name: '行政套房1501',
      code: 'HOTEL_SUITE_1501',
      resource_type: 'PHYSICAL',
      resource_type_name: '物理资源',
      resource_sub_type: 'ROOM',
      resource_sub_type_name: '客房',
      parent_id: 2,
      parent_name: '15楼',
      level: 3,
      icon: 'ant-design:home-outlined',
      color: '#fa8c16',
      image_url: '/images/suite-1501.jpg',
      status: 1,
      description: '豪华行政套房，配备全套设施',
      properties: JSON.stringify({
        room_number: '1501',
        room_type: '行政套房',
        bed_count: 2,
        area: 80,
        floor: 15,
        orientation: '南',
        facilities: ['大床', '客厅', '书房', '衣帽间', '浴室', '阳台'],
        amenities: ['免费WiFi', '迷你吧', '保险箱', '浴袍', '拖鞋'],
        view: '城市景观',
        balcony: true,
      }),
      capabilities: JSON.stringify([
        {
          id: 'guest_service',
          code: 'GUEST_SERVICE',
          name: '客人服务能力',
          description: '提供客人服务请求、客房服务、投诉处理等能力',
          icon: 'ant-design:customer-service-outlined',
          color: '#eb2f96',
          type: 'business',
          enabled: true,
          priority: 85,
          version: '1.0.0',
          tags: ['客人服务', '投诉处理'],
          implementation: {
            type: 'service',
            serviceName: 'guestServiceService',
            methodName: 'handleServiceRequest',
            parameters: {
              serviceTypes: [
                'room_service',
                'housekeeping',
                'maintenance',
                'concierge',
              ],
              priorityLevels: ['low', 'medium', 'high', 'urgent'],
              enableAutoAssignment: true,
            },
          },
        },
        {
          id: 'housekeeping_management',
          code: 'HOUSEKEEPING_MANAGEMENT',
          name: '客房清洁能力',
          description: '提供客房清洁计划、清洁状态跟踪、清洁质量检查等能力',
          icon: 'ant-design:clean-outlined',
          color: '#13c2c2',
          type: 'business',
          enabled: true,
          priority: 90,
          version: '1.0.0',
          tags: ['客房清洁', '质量检查'],
          implementation: {
            type: 'workflow',
            processDefinitionId: 'housekeeping_process',
            version: '1.0.0',
            parameters: {
              cleaningSchedule: 'daily',
              qualityCheckRequired: true,
              enableRealTimeTracking: true,
            },
          },
        },
        {
          id: 'iot_device_management',
          code: 'IOT_DEVICE_MANAGEMENT',
          name: 'IoT设备管理能力',
          description: '提供智能门锁、温控器、照明等IoT设备管理能力',
          icon: 'ant-design:setting-outlined',
          color: '#722ed1',
          type: 'technical',
          enabled: true,
          priority: 85,
          version: '1.0.0',
          tags: ['IoT设备', '智能控制'],
          implementation: {
            type: 'service',
            serviceName: 'iotDeviceService',
            methodName: 'controlDevice',
            parameters: {
              deviceTypes: [
                'smart_lock',
                'thermostat',
                'lighting',
                'tv',
                'curtain',
              ],
              enableRemoteControl: true,
              enableAutomation: true,
            },
          },
        },
        {
          id: 'real_time_communication',
          code: 'REAL_TIME_COMMUNICATION',
          name: '实时通信能力',
          description: '提供客房服务、前台沟通等实时消息通信能力',
          icon: 'ant-design:message-outlined',
          color: '#fa8c16',
          type: 'technical',
          enabled: true,
          priority: 80,
          version: '1.0.0',
          tags: ['实时通信', '消息推送'],
          implementation: {
            type: 'service',
            serviceName: 'communicationService',
            methodName: 'sendMessage',
            parameters: {
              messageTypes: ['notification', 'alert', 'reminder'],
              enablePushNotification: true,
              enableSMS: true,
            },
          },
        },
        {
          id: 'security_monitoring',
          code: 'SECURITY_MONITORING',
          name: '安全监控能力',
          description: '提供酒店安全监控、门禁管理、访客登记等能力',
          icon: 'ant-design:safety-outlined',
          color: '#ff4d4f',
          type: 'technical',
          enabled: true,
          priority: 90,
          version: '1.0.0',
          tags: ['安全监控', '门禁管理'],
          implementation: {
            type: 'service',
            serviceName: 'securityService',
            methodName: 'monitorSecurity',
            parameters: {
              monitoringTypes: [
                'cctv',
                'access_control',
                'fire_alarm',
                'emergency_exit',
              ],
              enableFacialRecognition: true,
              enableVisitorManagement: true,
            },
          },
        },
      ]),
      constraints: JSON.stringify({
        min_stay: 1,
        max_stay: 30,
        smoking_allowed: false,
        pet_allowed: false,
        max_guests: 4,
        check_in_time: '14:00',
        check_out_time: '12:00',
        late_checkout: '14:00',
      }),
      metadata: JSON.stringify({
        business_type: 'HOTEL',
        room_status: 'available',
        last_cleaning: '2024-01-20 10:00:00',
        next_cleaning: '2024-01-21 10:00:00',
        maintenance_status: 'normal',
        iot_devices: ['智能门锁', '温控器', '照明系统', '窗帘'],
      }),
      trading: JSON.stringify({
        pricing: {
          costPrice: 800,
          operationalCost: 200,
          standardPrice: 1500,
          discountPrice: 1200,
          vipPrice: 1350,
          seasonalPrice: 1800,
        },
        partners: [
          {
            id: 1,
            name: '酒店预订系统',
            type: 'SYSTEM',
            status: 'active',
            description: '在线预订平台',
          },
          {
            id: 2,
            name: '客房服务团队',
            type: 'SERVICE',
            status: 'active',
            description: '客房清洁和维护服务',
          },
        ],
        rules: [
          {
            id: 1,
            name: 'VIP客户优惠',
            type: 'LOYALTY',
            enabled: true,
            description: 'VIP客户享受9折优惠',
          },
          {
            id: 2,
            name: '长期住宿优惠',
            type: 'DISCOUNT',
            enabled: true,
            description: '连续住宿7天以上享受8折优惠',
          },
        ],
        history: [
          {
            id: 1,
            type: 'BOOKING',
            amount: 1500,
            partner: '酒店预订系统',
            status: 'completed',
            timestamp: '2024-01-20 14:00:00',
          },
          {
            id: 2,
            type: 'SERVICE',
            amount: 100,
            partner: '客房服务团队',
            status: 'completed',
            timestamp: '2024-01-19 10:30:00',
          },
        ],
      }),
      business_type: 'HOTEL',
      business_id: 1,
      tenant_id: 1,
      creator: 'admin',
      create_time: '2024-01-01 00:00:00',
      updater: 'admin',
      update_time: '2024-01-01 00:00:00',
      deleted: 0,
    },

    // ==================== 公寓业态 ====================
    {
      id: 4,
      name: '青年公寓A座',
      code: 'APARTMENT_BUILDING_A',
      resource_type: 'PHYSICAL',
      resource_type_name: '物理资源',
      resource_sub_type: 'BUILDING',
      resource_sub_type_name: '建筑物',
      parent_id: null,
      parent_name: null,
      level: 1,
      icon: 'ant-design:home-outlined',
      color: '#52c41a',
      image_url: '/images/apartment-building.jpg',
      status: 1,
      description: '青年公寓主楼，长租公寓',
      properties: JSON.stringify({
        // 使用VbenFormSchema格式的属性定义
        schema: [
          {
            fieldName: 'building_type',
            label: '建筑类型',
            component: 'Select',
            componentProps: {
              placeholder: '请选择建筑类型',
              options: [
                { label: '酒店', value: '酒店' },
                { label: '公寓', value: '公寓' },
                { label: '办公楼', value: '办公楼' },
                { label: '商场', value: '商场' },
                { label: '医院', value: '医院' },
                { label: '学校', value: '学校' },
              ],
              showSearch: true,
            },
            rules: 'required',
            defaultValue: '公寓',
          },
          {
            fieldName: 'floors',
            label: '楼层数',
            component: 'InputNumber',
            componentProps: {
              placeholder: '请输入楼层数',
              min: 1,
              max: 200,
              addonAfter: '层',
            },
            rules: 'required',
            defaultValue: 20,
          },
          {
            fieldName: 'total_rooms',
            label: '房间总数',
            component: 'InputNumber',
            componentProps: {
              placeholder: '请输入房间总数',
              min: 1,
              max: 10000,
              addonAfter: '间',
            },
            rules: 'required',
            defaultValue: 150,
          },
          {
            fieldName: 'construction_year',
            label: '建造年份',
            component: 'InputNumber',
            componentProps: {
              placeholder: '请输入建造年份',
              min: 1900,
              max: 2030,
              addonAfter: '年',
            },
            rules: 'required',
            defaultValue: 2021,
          },
          {
            fieldName: 'apartment_type',
            label: '公寓类型',
            component: 'Select',
            componentProps: {
              placeholder: '请选择公寓类型',
              options: [
                { label: '长租', value: '长租' },
                { label: '短租', value: '短租' },
                { label: '混合', value: '混合' },
              ],
            },
            rules: 'required',
            defaultValue: '长租',
          },
          {
            fieldName: 'facilities',
            label: '配套设施',
            component: 'Select',
            componentProps: {
              mode: 'multiple',
              placeholder: '请选择配套设施',
              options: [
                { label: '电梯', value: '电梯' },
                { label: '门禁系统', value: '门禁系统' },
                { label: '公共厨房', value: '公共厨房' },
                { label: '洗衣房', value: '洗衣房' },
                { label: '健身房', value: '健身房' },
                { label: '休息区', value: '休息区' },
                { label: '停车场', value: '停车场' },
                { label: '监控系统', value: '监控系统' },
                { label: '消防系统', value: '消防系统' },
                { label: 'WiFi覆盖', value: 'WiFi覆盖' },
                { label: '快递柜', value: '快递柜' },
                { label: '自行车棚', value: '自行车棚' },
              ],
              showSearch: true,
              allowClear: true,
            },
            defaultValue: ['电梯', '门禁系统', '公共厨房', '洗衣房'],
          },
          {
            fieldName: 'parking_spaces',
            label: '停车位数量',
            component: 'InputNumber',
            componentProps: {
              placeholder: '请输入停车位数量',
              min: 0,
              max: 10000,
              addonAfter: '个',
            },
            defaultValue: 80,
          },
          {
            fieldName: 'rental_period',
            label: '租赁周期',
            component: 'Input',
            componentProps: {
              placeholder: '请输入租赁周期',
            },
            defaultValue: '3-12个月',
          },
          {
            fieldName: 'building_status',
            label: '建筑状态',
            component: 'Select',
            componentProps: {
              placeholder: '请选择建筑状态',
              options: [
                { label: '正常运营', value: '正常运营' },
                { label: '装修中', value: '装修中' },
                { label: '暂停营业', value: '暂停营业' },
                { label: '已停业', value: '已停业' },
              ],
            },
            rules: 'required',
            defaultValue: '正常运营',
          },
        ],
        // 属性数据
        data: {
          building_type: '公寓',
          floors: 20,
          total_rooms: 150,
          construction_year: 2021,
          apartment_type: '长租',
          facilities: ['电梯', '门禁系统', '公共厨房', '洗衣房'],
          parking_spaces: 80,
          rental_period: '3-12个月',
          building_status: '正常运营',
        },
      }),
      capabilities: JSON.stringify([
        {
          id: 'guest_service',
          code: 'GUEST_SERVICE',
          name: '客户服务能力',
          description: '提供客户咨询、投诉处理、服务请求等客户服务能力',
          icon: 'ant-design:customer-service-outlined',
          color: '#52c41a',
          type: 'business',
          enabled: true,
          priority: 75,
          version: '1.0.0',
          tags: ['客户服务', '咨询处理'],
          implementation: {
            type: 'service',
            serviceName: 'guestServiceService',
            methodName: 'handleServiceRequest',
            parameters: {
              serviceTypes: [
                'consultation',
                'complaint',
                'request',
                'feedback',
              ],
              responseTime: '2h',
              enableEscalation: true,
            },
          },
        },
        {
          id: 'housekeeping_management',
          code: 'HOUSEKEEPING_MANAGEMENT',
          name: '家政管理能力',
          description: '提供房间清洁、维护保养、设施管理等家政服务能力',
          icon: 'ant-design:tool-outlined',
          color: '#1890ff',
          type: 'business',
          enabled: true,
          priority: 70,
          version: '1.0.0',
          tags: ['家政服务', '维护保养'],
          implementation: {
            type: 'service',
            serviceName: 'housekeepingService',
            methodName: 'scheduleMaintenance',
            parameters: {
              maintenanceTypes: [
                'cleaning',
                'repair',
                'inspection',
                'replacement',
              ],
              scheduleInterval: 'weekly',
              enableNotifications: true,
            },
          },
        },
        {
          id: 'iot_device_management',
          code: 'IOT_DEVICE_MANAGEMENT',
          name: 'IoT设备管理能力',
          description: '提供智能设备监控、远程控制、数据采集等IoT管理能力',
          icon: 'ant-design:cloud-outlined',
          color: '#722ed1',
          type: 'technical',
          enabled: true,
          priority: 75,
          version: '1.0.0',
          tags: ['IoT管理', '设备监控'],
          implementation: {
            type: 'service',
            serviceName: 'iotDeviceService',
            methodName: 'monitorDevices',
            parameters: {
              deviceTypes: ['sensor', 'controller', 'gateway', 'display'],
              monitoringInterval: '5min',
              enableAlerts: true,
            },
          },
        },
        {
          id: 'real_time_communication',
          code: 'REAL_TIME_COMMUNICATION',
          name: '实时通信能力',
          description: '提供即时消息、通知推送、语音通话等实时通信能力',
          icon: 'ant-design:message-outlined',
          color: '#fa8c16',
          type: 'technical',
          enabled: true,
          priority: 70,
          version: '1.0.0',
          tags: ['实时通信', '消息推送'],
          implementation: {
            type: 'service',
            serviceName: 'communicationService',
            methodName: 'sendMessage',
            parameters: {
              messageTypes: ['text', 'voice', 'image', 'notification'],
              deliveryMethods: ['push', 'sms', 'email', 'in-app'],
              enableEncryption: true,
            },
          },
        },
        {
          id: 'security_monitoring',
          code: 'SECURITY_MONITORING',
          name: '安全监控能力',
          description: '提供视频监控、门禁控制、安全警报等安全监控能力',
          icon: 'ant-design:safety-outlined',
          color: '#f5222d',
          type: 'security',
          enabled: true,
          priority: 80,
          version: '1.0.0',
          tags: ['安全监控', '门禁控制'],
          implementation: {
            type: 'service',
            serviceName: 'securityService',
            methodName: 'monitorSecurity',
            parameters: {
              monitoringTypes: ['video', 'access', 'alarm', 'patrol'],
              recordingRetention: '30days',
              enableRealTimeAlert: true,
            },
          },
        },
      ]),
      constraints: JSON.stringify({
        max_height: 60,
        fire_safety: true,
        accessibility: true,
        min_rental_period: 3,
        max_rental_period: 12,
      }),
      metadata: JSON.stringify({
        business_type: 'APARTMENT',
        address: '大学城附近',
        property_management: '自营',
        target_audience: '青年群体',
        rental_type: '长租',
      }),
      business_type: 'APARTMENT',
      business_id: 2,
      tenant_id: 1,
      creator: 'admin',
      create_time: '2024-01-01 00:00:00',
      updater: 'admin',
      update_time: '2024-01-01 00:00:00',
      deleted: 0,
    },

    // ==================== 温泉业态 ====================
    {
      id: 5,
      name: '温泉度假村',
      code: 'SPA_RESORT_MAIN',
      resource_type: 'PHYSICAL',
      resource_type_name: '物理资源',
      resource_sub_type: 'RESORT',
      resource_sub_type_name: '度假村',
      parent_id: null,
      parent_name: null,
      level: 1,
      icon: 'ant-design:heart-outlined',
      color: '#eb2f96',
      image_url: '/images/spa-resort.jpg',
      status: 1,
      description: '温泉度假村主园区',
      properties: JSON.stringify({
        resort_type: '温泉度假',
        total_area: 50000,
        construction_year: 2019,
        facilities: ['温泉池', 'SPA中心', '餐厅', '客房', '停车场'],
        parking_spaces: 200,
        service_quality: '五星级',
      }),
      capabilities: JSON.stringify([
        {
          id: 'guest_service',
          code: 'GUEST_SERVICE',
          name: '客户服务能力',
          description: '提供客户咨询、投诉处理、服务请求等客户服务能力',
          icon: 'ant-design:customer-service-outlined',
          color: '#52c41a',
          type: 'business',
          enabled: true,
          priority: 85,
          version: '1.0.0',
          tags: ['客户服务', '咨询处理'],
          implementation: {
            type: 'service',
            serviceName: 'guestServiceService',
            methodName: 'handleServiceRequest',
            parameters: {
              serviceTypes: [
                'consultation',
                'complaint',
                'request',
                'feedback',
              ],
              responseTime: '1h',
              enableEscalation: true,
            },
          },
        },
        {
          id: 'housekeeping_management',
          code: 'HOUSEKEEPING_MANAGEMENT',
          name: '家政管理能力',
          description: '提供房间清洁、维护保养、设施管理等家政服务能力',
          icon: 'ant-design:tool-outlined',
          color: '#1890ff',
          type: 'business',
          enabled: true,
          priority: 75,
          version: '1.0.0',
          tags: ['家政服务', '维护保养'],
          implementation: {
            type: 'service',
            serviceName: 'housekeepingService',
            methodName: 'scheduleMaintenance',
            parameters: {
              maintenanceTypes: [
                'cleaning',
                'repair',
                'inspection',
                'replacement',
              ],
              scheduleInterval: 'daily',
              enableNotifications: true,
            },
          },
        },
        {
          id: 'iot_device_management',
          code: 'IOT_DEVICE_MANAGEMENT',
          name: 'IoT设备管理能力',
          description: '提供智能设备监控、远程控制、数据采集等IoT管理能力',
          icon: 'ant-design:cloud-outlined',
          color: '#722ed1',
          type: 'technical',
          enabled: true,
          priority: 70,
          version: '1.0.0',
          tags: ['IoT管理', '设备监控'],
          implementation: {
            type: 'service',
            serviceName: 'iotDeviceService',
            methodName: 'monitorDevices',
            parameters: {
              deviceTypes: ['sensor', 'controller', 'gateway', 'display'],
              monitoringInterval: '3min',
              enableAlerts: true,
            },
          },
        },
        {
          id: 'real_time_communication',
          code: 'REAL_TIME_COMMUNICATION',
          name: '实时通信能力',
          description: '提供即时消息、通知推送、语音通话等实时通信能力',
          icon: 'ant-design:message-outlined',
          color: '#fa8c16',
          type: 'technical',
          enabled: true,
          priority: 75,
          version: '1.0.0',
          tags: ['实时通信', '消息推送'],
          implementation: {
            type: 'service',
            serviceName: 'communicationService',
            methodName: 'sendMessage',
            parameters: {
              messageTypes: ['text', 'voice', 'image', 'notification'],
              deliveryMethods: ['push', 'sms', 'email', 'in-app'],
              enableEncryption: true,
            },
          },
        },
        {
          id: 'security_monitoring',
          code: 'SECURITY_MONITORING',
          name: '安全监控能力',
          description: '提供视频监控、门禁控制、安全警报等安全监控能力',
          icon: 'ant-design:safety-outlined',
          color: '#f5222d',
          type: 'security',
          enabled: true,
          priority: 75,
          version: '1.0.0',
          tags: ['安全监控', '门禁控制'],
          implementation: {
            type: 'service',
            serviceName: 'securityService',
            methodName: 'monitorSecurity',
            parameters: {
              monitoringTypes: ['video', 'access', 'alarm', 'patrol'],
              recordingRetention: '90days',
              enableRealTimeAlert: true,
            },
          },
        },
      ]),
      constraints: JSON.stringify({
        max_height: 15,
        fire_safety: true,
        accessibility: true,
        water_quality: 'A级',
        health_standards: '严格',
      }),
      metadata: JSON.stringify({
        business_type: 'SPA',
        address: '温泉度假区',
        property_management: '自营',
        wellness_services: true,
        certification: '健康管理认证',
      }),
      business_type: 'SPA',
      business_id: 3,
      tenant_id: 1,
      creator: 'admin',
      create_time: '2024-01-01 00:00:00',
      updater: 'admin',
      update_time: '2024-01-01 00:00:00',
      deleted: 0,
    },

    // ==================== 景区业态 ====================
    {
      id: 6,
      name: '山水景区',
      code: 'SCENIC_AREA_MAIN',
      resource_type: 'PHYSICAL',
      resource_type_name: '物理资源',
      resource_sub_type: 'SCENIC',
      resource_sub_type_name: '景区',
      parent_id: null,
      parent_name: null,
      level: 1,
      icon: 'ant-design:environment-outlined',
      color: '#13c2c2',
      image_url: '/images/scenic-area.jpg',
      status: 1,
      description: '山水景区主园区',
      properties: JSON.stringify({
        scenic_type: '山水景区',
        total_area: 100000,
        construction_year: 2018,
        facilities: ['观景台', '步道', '休息区', '停车场', '游客中心'],
        parking_spaces: 500,
        service_quality: '四星级',
      }),
      capabilities: JSON.stringify([
        {
          id: 'guest_service',
          code: 'GUEST_SERVICE',
          name: '客户服务能力',
          description: '提供游客咨询、投诉处理、服务请求等客户服务能力',
          icon: 'ant-design:customer-service-outlined',
          color: '#52c41a',
          type: 'business',
          enabled: true,
          priority: 85,
          version: '1.0.0',
          tags: ['客户服务', '咨询处理'],
          implementation: {
            type: 'service',
            serviceName: 'guestServiceService',
            methodName: 'handleServiceRequest',
            parameters: {
              serviceTypes: [
                'consultation',
                'complaint',
                'request',
                'feedback',
              ],
              responseTime: '30min',
              enableEscalation: true,
            },
          },
        },
        {
          id: 'iot_device_management',
          code: 'IOT_DEVICE_MANAGEMENT',
          name: 'IoT设备管理能力',
          description: '提供智能设备监控、远程控制、数据采集等IoT管理能力',
          icon: 'ant-design:cloud-outlined',
          color: '#722ed1',
          type: 'technical',
          enabled: true,
          priority: 65,
          version: '1.0.0',
          tags: ['IoT管理', '设备监控'],
          implementation: {
            type: 'service',
            serviceName: 'iotDeviceService',
            methodName: 'monitorDevices',
            parameters: {
              deviceTypes: ['sensor', 'controller', 'gateway', 'display'],
              monitoringInterval: '10min',
              enableAlerts: true,
            },
          },
        },
        {
          id: 'real_time_communication',
          code: 'REAL_TIME_COMMUNICATION',
          name: '实时通信能力',
          description: '提供即时消息、通知推送、语音通话等实时通信能力',
          icon: 'ant-design:message-outlined',
          color: '#fa8c16',
          type: 'technical',
          enabled: true,
          priority: 75,
          version: '1.0.0',
          tags: ['实时通信', '消息推送'],
          implementation: {
            type: 'service',
            serviceName: 'communicationService',
            methodName: 'sendMessage',
            parameters: {
              messageTypes: ['text', 'voice', 'image', 'notification'],
              deliveryMethods: ['push', 'sms', 'email', 'in-app'],
              enableEncryption: true,
            },
          },
        },
        {
          id: 'security_monitoring',
          code: 'SECURITY_MONITORING',
          name: '安全监控能力',
          description: '提供视频监控、门禁控制、安全警报等安全监控能力',
          icon: 'ant-design:safety-outlined',
          color: '#f5222d',
          type: 'security',
          enabled: true,
          priority: 85,
          version: '1.0.0',
          tags: ['安全监控', '门禁控制'],
          implementation: {
            type: 'service',
            serviceName: 'securityService',
            methodName: 'monitorSecurity',
            parameters: {
              monitoringTypes: ['video', 'access', 'alarm', 'patrol'],
              recordingRetention: '180days',
              enableRealTimeAlert: true,
            },
          },
        },
      ]),
      constraints: JSON.stringify({
        max_height: 0,
        fire_safety: true,
        accessibility: true,
        weather_dependent: true,
        environmental_protection: '严格',
      }),
      metadata: JSON.stringify({
        business_type: 'SCENIC',
        address: '山水风景区',
        property_management: '自营',
        guided_tours: true,
        environmental_certification: '绿色景区认证',
      }),
      business_type: 'SCENIC',
      business_id: 4,
      tenant_id: 1,
      creator: 'admin',
      create_time: '2024-01-01 00:00:00',
      updater: 'admin',
      update_time: '2024-01-01 00:00:00',
      deleted: 0,
    },

    // ==================== 餐饮业态 ====================
    {
      id: 7,
      name: '中餐厅',
      code: 'RESTAURANT_CHINESE',
      resource_type: 'PHYSICAL',
      resource_type_name: '物理资源',
      resource_sub_type: 'RESTAURANT',
      resource_sub_type_name: '餐厅',
      parent_id: null,
      parent_name: null,
      level: 1,
      icon: 'ant-design:coffee-outlined',
      color: '#fa8c16',
      image_url: '/images/chinese-restaurant.jpg',
      status: 1,
      description: '中餐厅，提供传统中式美食',
      properties: JSON.stringify({
        restaurant_type: '中餐',
        total_area: 300,
        construction_year: 2020,
        facilities: ['厨房', '用餐区', '包间', '收银台'],
        max_capacity: 120,
        parking_spaces: 20,
        service_quality: '四星级',
      }),
      capabilities: JSON.stringify([
        {
          id: 'guest_service',
          code: 'GUEST_SERVICE',
          name: '客户服务能力',
          description: '提供客户咨询、投诉处理、服务请求等客户服务能力',
          icon: 'ant-design:customer-service-outlined',
          color: '#52c41a',
          type: 'business',
          enabled: true,
          priority: 85,
          version: '1.0.0',
          tags: ['客户服务', '咨询处理'],
          implementation: {
            type: 'service',
            serviceName: 'guestServiceService',
            methodName: 'handleServiceRequest',
            parameters: {
              serviceTypes: [
                'consultation',
                'complaint',
                'request',
                'feedback',
              ],
              responseTime: '15min',
              enableEscalation: true,
            },
          },
        },
        {
          id: 'iot_device_management',
          code: 'IOT_DEVICE_MANAGEMENT',
          name: 'IoT设备管理能力',
          description: '提供智能设备监控、远程控制、数据采集等IoT管理能力',
          icon: 'ant-design:cloud-outlined',
          color: '#722ed1',
          type: 'technical',
          enabled: true,
          priority: 65,
          version: '1.0.0',
          tags: ['IoT管理', '设备监控'],
          implementation: {
            type: 'service',
            serviceName: 'iotDeviceService',
            methodName: 'monitorDevices',
            parameters: {
              deviceTypes: ['sensor', 'controller', 'gateway', 'display'],
              monitoringInterval: '15min',
              enableAlerts: true,
            },
          },
        },
        {
          id: 'real_time_communication',
          code: 'REAL_TIME_COMMUNICATION',
          name: '实时通信能力',
          description: '提供即时消息、通知推送、语音通话等实时通信能力',
          icon: 'ant-design:message-outlined',
          color: '#fa8c16',
          type: 'technical',
          enabled: true,
          priority: 75,
          version: '1.0.0',
          tags: ['实时通信', '消息推送'],
          implementation: {
            type: 'service',
            serviceName: 'communicationService',
            methodName: 'sendMessage',
            parameters: {
              messageTypes: ['text', 'voice', 'image', 'notification'],
              deliveryMethods: ['push', 'sms', 'email', 'in-app'],
              enableEncryption: true,
            },
          },
        },
        {
          id: 'security_monitoring',
          code: 'SECURITY_MONITORING',
          name: '安全监控能力',
          description: '提供视频监控、门禁控制、安全警报等安全监控能力',
          icon: 'ant-design:safety-outlined',
          color: '#f5222d',
          type: 'security',
          enabled: true,
          priority: 75,
          version: '1.0.0',
          tags: ['安全监控', '门禁控制'],
          implementation: {
            type: 'service',
            serviceName: 'securityService',
            methodName: 'monitorSecurity',
            parameters: {
              monitoringTypes: ['video', 'access', 'alarm', 'patrol'],
              recordingRetention: '60days',
              enableRealTimeAlert: true,
            },
          },
        },
      ]),
      constraints: JSON.stringify({
        max_height: 4,
        fire_safety: true,
        accessibility: true,
        food_safety: 'A级',
        hygiene_standards: '严格',
      }),
      metadata: JSON.stringify({
        business_type: 'RESTAURANT',
        address: '商业街',
        property_management: '自营',
        cuisine_type: '中式',
        food_safety_certification: '食品安全认证',
      }),
      business_type: 'RESTAURANT',
      business_id: 5,
      tenant_id: 1,
      creator: 'admin',
      create_time: '2024-01-01 00:00:00',
      updater: 'admin',
      update_time: '2024-01-01 00:00:00',
      deleted: 0,
    },

    // ==================== 医美业态 ====================
    {
      id: 8,
      name: '医美中心',
      code: 'MEDICAL_BEAUTY_CENTER',
      resource_type: 'PHYSICAL',
      resource_type_name: '物理资源',
      resource_sub_type: 'MEDICAL',
      resource_sub_type_name: '医疗机构',
      parent_id: null,
      parent_name: null,
      level: 1,
      icon: 'ant-design:medicine-box-outlined',
      color: '#722ed1',
      image_url: '/images/medical-beauty.jpg',
      status: 1,
      description: '医美中心，提供医疗美容服务',
      properties: JSON.stringify({
        center_type: '医美',
        total_area: 500,
        construction_year: 2021,
        facilities: ['咨询室', '治疗室', '恢复室', '药房'],
        max_capacity: 50,
        parking_spaces: 30,
        service_quality: '五星级',
      }),
      capabilities: JSON.stringify({
        guest_service: { enabled: true, priority: 85 },
        iot_device_management: { enabled: true, priority: 75 },
        real_time_communication: { enabled: true, priority: 80 },
        security_monitoring: { enabled: true, priority: 90 },
      }),
      constraints: JSON.stringify({
        max_height: 4,
        fire_safety: true,
        accessibility: true,
        medical_standards: '严格',
        health_licenses: 'A级',
      }),
      metadata: JSON.stringify({
        business_type: 'MEDICAL_BEAUTY',
        address: '医疗美容区',
        property_management: '自营',
        medical_license: 'A级',
        medical_certification: '医疗美容认证',
      }),
      business_type: 'MEDICAL_BEAUTY',
      business_id: 6,
      tenant_id: 1,
      creator: 'admin',
      create_time: '2024-01-01 00:00:00',
      updater: 'admin',
      update_time: '2024-01-01 00:00:00',
      deleted: 0,
    },

    // ==================== 美容美发业态 ====================
    {
      id: 9,
      name: '美容美发沙龙',
      code: 'BEAUTY_SALON_MAIN',
      resource_type: 'PHYSICAL',
      resource_type_name: '物理资源',
      resource_sub_type: 'SALON',
      resource_sub_type_name: '沙龙',
      parent_id: null,
      parent_name: null,
      level: 1,
      icon: 'ant-design:scissor-outlined',
      color: '#eb2f96',
      image_url: '/images/beauty-salon.jpg',
      status: 1,
      description: '美容美发沙龙，提供美容美发服务',
      properties: JSON.stringify({
        salon_type: '美容美发',
        total_area: 200,
        construction_year: 2022,
        facilities: ['美发区', '美容区', '洗头区', '休息区'],
        max_capacity: 30,
        parking_spaces: 15,
        service_quality: '四星级',
      }),
      capabilities: JSON.stringify({
        guest_service: { enabled: true, priority: 80 },
        iot_device_management: { enabled: true, priority: 65 },
        real_time_communication: { enabled: true, priority: 70 },
        security_monitoring: { enabled: true, priority: 70 },
      }),
      constraints: JSON.stringify({
        max_height: 3,
        fire_safety: true,
        accessibility: true,
        hygiene_standards: '严格',
        beauty_licenses: 'B级',
      }),
      metadata: JSON.stringify({
        business_type: 'BEAUTY_SALON',
        address: '商业街',
        property_management: '自营',
        service_types: ['美发', '美容', '美甲'],
        beauty_certification: '美容美发认证',
      }),
      business_type: 'BEAUTY_SALON',
      business_id: 7,
      tenant_id: 1,
      creator: 'admin',
      create_time: '2024-01-01 00:00:00',
      updater: 'admin',
      update_time: '2024-01-01 00:00:00',
      deleted: 0,
    },

    // ==================== 数字资源 ====================
    {
      id: 10,
      name: '酒店管理系统',
      code: 'HOTEL_MANAGEMENT_SYSTEM',
      resource_type: 'DIGITAL',
      resource_type_name: '数字资源',
      resource_sub_type: 'SOFTWARE',
      resource_sub_type_name: '软件',
      parent_id: null,
      parent_name: null,
      level: 1,
      icon: 'ant-design:laptop-outlined',
      color: '#13c2c2',
      image_url: '/images/hotel-system.jpg',
      status: 1,
      description: '酒店核心业务管理系统',
      properties: JSON.stringify({
        system_type: 'PMS',
        version: 'v2.1.0',
        technology_stack: ['Vue3', 'Node.js', 'MySQL'],
        deployment: 'cloud',
        modules: ['预订管理', '客房管理', '财务管理', '报表分析'],
        integrations: ['OTA', '支付系统', '门锁系统'],
        api_endpoints: 50,
      }),
      capabilities: JSON.stringify([
        {
          id: 'room_management',
          code: 'ROOM_MANAGEMENT',
          name: '客房管理能力',
          description: '提供客房状态管理、房态更新、房间分配等核心能力',
          icon: 'ant-design:home-outlined',
          color: '#52c41a',
          type: 'business',
          enabled: true,
          priority: 90,
          version: '1.0.0',
          tags: ['客房管理', '房态管理'],
          implementation: {
            type: 'service',
            serviceName: 'roomManagementService',
            methodName: 'updateRoomStatus',
            parameters: {
              statusTypes: [
                'vacant',
                'occupied',
                'reserved',
                'maintenance',
                'dirty',
              ],
              enableRealTimeSync: true,
              autoStatusTransition: true,
            },
          },
        },
        {
          id: 'booking_management',
          code: 'BOOKING_MANAGEMENT',
          name: '预订管理能力',
          description: '提供客房预订、订单处理、预订确认等业务能力',
          icon: 'ant-design:calendar-outlined',
          color: '#1890ff',
          type: 'business',
          enabled: true,
          priority: 95,
          version: '1.0.0',
          tags: ['预订管理', '订单处理'],
          implementation: {
            type: 'service',
            serviceName: 'bookingManagementService',
            methodName: 'processBooking',
            parameters: {
              bookingTypes: ['individual', 'group', 'corporate'],
              paymentMethods: ['cash', 'card', 'online', 'voucher'],
              enableOverbooking: true,
              maxOverbookingRate: 0.1,
            },
          },
        },
        {
          id: 'checkin_checkout',
          code: 'CHECKIN_CHECKOUT',
          name: '入住退房能力',
          description: '提供客人入住登记、退房结算、房卡管理等能力',
          icon: 'ant-design:user-add-outlined',
          color: '#722ed1',
          type: 'business',
          enabled: true,
          priority: 90,
          version: '1.0.0',
          tags: ['入住管理', '退房管理'],
          implementation: {
            type: 'workflow',
            processDefinitionId: 'checkin_checkout_process',
            version: '1.0.0',
            parameters: {
              enableAutoCheckout: true,
              lateCheckoutAllowed: true,
              maxLateCheckoutHours: 2,
              enableExpressCheckout: true,
            },
          },
        },
        {
          id: 'pricing_engine',
          code: 'PRICING_ENGINE',
          name: '定价引擎能力',
          description: '提供动态定价、价格策略、优惠计算等能力',
          icon: 'ant-design:dollar-outlined',
          color: '#fa8c16',
          type: 'business',
          enabled: true,
          priority: 85,
          version: '1.0.0',
          tags: ['定价策略', '价格管理'],
          implementation: {
            type: 'rule',
            ruleSetName: 'hotel_pricing_rules',
            engine: 'drools',
            parameters: {
              pricingFactors: ['season', 'occupancy', 'competition', 'demand'],
              enableDynamicPricing: true,
              updateFrequency: 'hourly',
              enableAIBasedPricing: true,
            },
          },
        },
        {
          id: 'guest_service',
          code: 'GUEST_SERVICE',
          name: '客人服务能力',
          description: '提供客人服务请求、客房服务、投诉处理等能力',
          icon: 'ant-design:customer-service-outlined',
          color: '#eb2f96',
          type: 'business',
          enabled: true,
          priority: 80,
          version: '1.0.0',
          tags: ['客人服务', '投诉处理'],
          implementation: {
            type: 'service',
            serviceName: 'guestServiceService',
            methodName: 'handleServiceRequest',
            parameters: {
              serviceTypes: [
                'room_service',
                'housekeeping',
                'maintenance',
                'concierge',
              ],
              priorityLevels: ['low', 'medium', 'high', 'urgent'],
              enableAutoAssignment: true,
            },
          },
        },
        {
          id: 'housekeeping_management',
          code: 'HOUSEKEEPING_MANAGEMENT',
          name: '客房清洁能力',
          description: '提供客房清洁计划、清洁状态跟踪、清洁质量检查等能力',
          icon: 'ant-design:clean-outlined',
          color: '#13c2c2',
          type: 'business',
          enabled: true,
          priority: 85,
          version: '1.0.0',
          tags: ['客房清洁', '质量检查'],
          implementation: {
            type: 'workflow',
            processDefinitionId: 'housekeeping_process',
            version: '1.0.0',
            parameters: {
              cleaningSchedule: 'daily',
              qualityCheckRequired: true,
              enableRealTimeTracking: true,
            },
          },
        },
        {
          id: 'pms_integration',
          code: 'PMS_INTEGRATION',
          name: 'PMS系统集成能力',
          description: '提供与酒店PMS系统的数据同步和业务集成能力',
          icon: 'ant-design:api-outlined',
          color: '#1890ff',
          type: 'technical',
          enabled: true,
          priority: 95,
          version: '1.0.0',
          tags: ['系统集成', '数据同步'],
          implementation: {
            type: 'api',
            apiEndpoint: '/api/pms/integration',
            method: 'POST',
            parameters: {
              syncInterval: '5min',
              enableRealTimeSync: true,
              dataTypes: ['booking', 'room_status', 'guest_info'],
            },
          },
        },
        {
          id: 'payment_gateway',
          code: 'PAYMENT_GATEWAY',
          name: '支付网关能力',
          description: '提供多种支付方式集成和支付处理能力',
          icon: 'ant-design:credit-card-outlined',
          color: '#52c41a',
          type: 'technical',
          enabled: true,
          priority: 90,
          version: '1.0.0',
          tags: ['支付处理', '网关集成'],
          implementation: {
            type: 'service',
            serviceName: 'paymentGatewayService',
            methodName: 'processPayment',
            parameters: {
              paymentMethods: [
                'alipay',
                'wechat',
                'unionpay',
                'visa',
                'mastercard',
              ],
              enableRefund: true,
              enablePartialRefund: true,
            },
          },
        },
        {
          id: 'iot_device_management',
          code: 'IOT_DEVICE_MANAGEMENT',
          name: 'IoT设备管理能力',
          description: '提供智能门锁、温控器、照明等IoT设备管理能力',
          icon: 'ant-design:setting-outlined',
          color: '#722ed1',
          type: 'technical',
          enabled: true,
          priority: 80,
          version: '1.0.0',
          tags: ['IoT设备', '智能控制'],
          implementation: {
            type: 'service',
            serviceName: 'iotDeviceService',
            methodName: 'controlDevice',
            parameters: {
              deviceTypes: [
                'smart_lock',
                'thermostat',
                'lighting',
                'tv',
                'curtain',
              ],
              enableRemoteControl: true,
              enableAutomation: true,
            },
          },
        },
        {
          id: 'real_time_communication',
          code: 'REAL_TIME_COMMUNICATION',
          name: '实时通信能力',
          description: '提供客房服务、前台沟通等实时消息通信能力',
          icon: 'ant-design:message-outlined',
          color: '#fa8c16',
          type: 'technical',
          enabled: true,
          priority: 85,
          version: '1.0.0',
          tags: ['实时通信', '消息推送'],
          implementation: {
            type: 'service',
            serviceName: 'communicationService',
            methodName: 'sendMessage',
            parameters: {
              messageTypes: ['notification', 'alert', 'reminder'],
              enablePushNotification: true,
              enableSMS: true,
            },
          },
        },
        {
          id: 'data_analytics',
          code: 'DATA_ANALYTICS',
          name: '数据分析能力',
          description: '提供酒店运营数据分析和商业智能能力',
          icon: 'ant-design:bar-chart-outlined',
          color: '#eb2f96',
          type: 'technical',
          enabled: true,
          priority: 80,
          version: '1.0.0',
          tags: ['数据分析', '商业智能'],
          implementation: {
            type: 'service',
            serviceName: 'analyticsService',
            methodName: 'analyzeData',
            parameters: {
              analysisTypes: [
                'occupancy',
                'revenue',
                'guest_satisfaction',
                'operational_efficiency',
              ],
              enablePredictiveAnalytics: true,
              enableRealTimeDashboards: true,
            },
          },
        },
        {
          id: 'security_monitoring',
          code: 'SECURITY_MONITORING',
          name: '安全监控能力',
          description: '提供酒店安全监控、门禁管理、访客登记等能力',
          icon: 'ant-design:safety-outlined',
          color: '#ff4d4f',
          type: 'technical',
          enabled: true,
          priority: 85,
          version: '1.0.0',
          tags: ['安全监控', '门禁管理'],
          implementation: {
            type: 'service',
            serviceName: 'securityService',
            methodName: 'monitorSecurity',
            parameters: {
              monitoringTypes: [
                'cctv',
                'access_control',
                'fire_alarm',
                'emergency_exit',
              ],
              enableFacialRecognition: true,
              enableVisitorManagement: true,
            },
          },
        },
      ]),
      constraints: JSON.stringify({
        browser_support: ['Chrome', 'Firefox', 'Safari'],
        mobile_support: true,
        concurrent_users: 100,
        response_time: '<2s',
        uptime: '99.9%',
      }),
      metadata: JSON.stringify({
        business_type: 'HOTEL',
        vendor: '酒店科技公司',
        license_type: 'enterprise',
        system_admin: '技术团队',
        last_update: '2024-01-15',
      }),
      business_type: 'HOTEL',
      business_id: 1,
      tenant_id: 1,
      creator: 'admin',
      create_time: '2024-01-01 00:00:00',
      updater: 'admin',
      update_time: '2024-01-01 00:00:00',
      deleted: 0,
    },

    // ==================== 人力资源 ====================
    {
      id: 11,
      name: '酒店管理团队',
      code: 'HOTEL_MANAGEMENT_TEAM',
      resource_type: 'HUMAN',
      resource_type_name: '人力资源',
      resource_sub_type: 'TEAM',
      resource_sub_type_name: '团队',
      parent_id: null,
      parent_name: null,
      level: 1,
      icon: 'ant-design:team-outlined',
      color: '#722ed1',
      image_url: '/images/management-team.jpg',
      status: 1,
      description: '酒店核心管理团队',
      properties: JSON.stringify({
        team_size: 15,
        departments: ['前厅部', '客房部', '餐饮部', '财务部', '工程部'],
        experience_years: 8,
        management_level: 'senior',
        certifications: ['酒店管理师', 'ISO9001内审员'],
      }),
      capabilities: JSON.stringify([
        {
          id: 'guest_service',
          code: 'GUEST_SERVICE',
          name: '客人服务能力',
          description: '提供客人服务请求、客房服务、投诉处理等能力',
          icon: 'ant-design:customer-service-outlined',
          color: '#eb2f96',
          type: 'business',
          enabled: true,
          priority: 85,
          version: '1.0.0',
          tags: ['客人服务', '投诉处理'],
          implementation: {
            type: 'service',
            serviceName: 'guestServiceService',
            methodName: 'handleServiceRequest',
            parameters: {
              serviceTypes: [
                'room_service',
                'housekeeping',
                'maintenance',
                'concierge',
              ],
              priorityLevels: ['low', 'medium', 'high', 'urgent'],
              enableAutoAssignment: true,
            },
          },
        },
        {
          id: 'housekeeping_management',
          code: 'HOUSEKEEPING_MANAGEMENT',
          name: '客房清洁能力',
          description: '提供客房清洁计划、清洁状态跟踪、清洁质量检查等能力',
          icon: 'ant-design:clean-outlined',
          color: '#13c2c2',
          type: 'business',
          enabled: true,
          priority: 80,
          version: '1.0.0',
          tags: ['客房清洁', '质量检查'],
          implementation: {
            type: 'workflow',
            processDefinitionId: 'housekeeping_process',
            version: '1.0.0',
            parameters: {
              cleaningSchedule: 'daily',
              qualityCheckRequired: true,
              enableRealTimeTracking: true,
            },
          },
        },
        {
          id: 'data_analytics',
          code: 'DATA_ANALYTICS',
          name: '数据分析能力',
          description: '提供酒店运营数据分析和商业智能能力',
          icon: 'ant-design:bar-chart-outlined',
          color: '#eb2f96',
          type: 'technical',
          enabled: true,
          priority: 75,
          version: '1.0.0',
          tags: ['数据分析', '商业智能'],
          implementation: {
            type: 'service',
            serviceName: 'analyticsService',
            methodName: 'analyzeData',
            parameters: {
              analysisTypes: [
                'occupancy',
                'revenue',
                'guest_satisfaction',
                'operational_efficiency',
              ],
              enablePredictiveAnalytics: true,
              enableRealTimeDashboards: true,
            },
          },
        },
        {
          id: 'real_time_communication',
          code: 'REAL_TIME_COMMUNICATION',
          name: '实时通信能力',
          description: '提供客房服务、前台沟通等实时消息通信能力',
          icon: 'ant-design:message-outlined',
          color: '#fa8c16',
          type: 'technical',
          enabled: true,
          priority: 80,
          version: '1.0.0',
          tags: ['实时通信', '消息推送'],
          implementation: {
            type: 'service',
            serviceName: 'communicationService',
            methodName: 'sendMessage',
            parameters: {
              messageTypes: ['notification', 'alert', 'reminder'],
              enablePushNotification: true,
              enableSMS: true,
            },
          },
        },
      ]),
      constraints: JSON.stringify({
        working_hours: '8:00-18:00',
        availability: 'full_time',
        location: '酒店内',
        overtime_limit: 2,
        rest_days: ['轮休'],
      }),
      metadata: JSON.stringify({
        business_type: 'HOTEL',
        team_leader: '张经理',
        department_heads: ['前厅经理', '客房经理', '餐饮经理', '财务经理'],
        performance_rating: 'A+',
      }),
      business_type: 'HOTEL',
      business_id: 1,
      tenant_id: 1,
      creator: 'admin',
      create_time: '2024-01-01 00:00:00',
      updater: 'admin',
      update_time: '2024-01-01 00:00:00',
      deleted: 0,
    },
  ];

  // 过滤逻辑
  let filteredResources = resources;

  if (query.category_id) {
    const categoryId = parseInt(query.category_id as string);
    filteredResources = filteredResources.filter(
      (resource) => resource.category_id === categoryId,
    );
  }

  // 支持父子结构查询
  if (query.parent_id !== undefined) {
    const parentId =
      query.parent_id === 'null' ? null : parseInt(query.parent_id as string);
    filteredResources = filteredResources.filter(
      (resource) => resource.parent_id === parentId,
    );
  }

  // 支持层级查询
  if (query.level !== undefined) {
    const level = parseInt(query.level as string);
    filteredResources = filteredResources.filter(
      (resource) => resource.level === level,
    );
  }

  if (query.resource_type) {
    filteredResources = filteredResources.filter(
      (resource) => resource.resource_type === query.resource_type,
    );
  }

  if (query.status !== undefined) {
    filteredResources = filteredResources.filter(
      (resource) => resource.status === parseInt(query.status as string),
    );
  }

  if (query.keyword) {
    const keyword = query.keyword as string;
    filteredResources = filteredResources.filter(
      (resource) =>
        resource.name.includes(keyword) ||
        resource.code.includes(keyword) ||
        resource.description.includes(keyword),
    );
  }

  // 分页
  const page =
    parseInt(query.pageNo as string) || parseInt(query.page as string) || 1;
  const pageSize = parseInt(query.pageSize as string) || 10;
  const start = (page - 1) * pageSize;
  const end = start + pageSize;
  const items = filteredResources.slice(start, end);

  return {
    code: 0,
    data: {
      items,
      total: filteredResources.length,
      page,
      pageSize,
    },
    msg: '获取资源列表成功',
  };
});
